home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / skey40.zip / MENUDEMO.BAT < prev    next >
DOS Batch File  |  1991-12-23  |  4KB  |  105 lines

  1. :Batutil c(o) 1990, 1991 Barry Simon and Richard Wilson
  2. : Version 4.0
  3. echo off
  4. cls
  5. batutil {inc %0 code}
  6. goto end
  7. :echo1
  8. @0AWelcome to the demonstration of @8EBATUTIL@0A's menu making
  9. @0A  You can make all sorts of menus and get the user's choice returned
  10.   in the errorlevel and also in the environment.  In a moment we'll
  11.   show you a typical menu.  For every menu we show you'll have to
  12.   make a choice although the choice won't have any effect in this
  13.   demo.  After the first we'll show you the choice made and the command to
  14.   make the menu.  At any menu hitting <Esc> will exit the batch file.
  15. Now please hit a key to continue.
  16. :echo2
  17. this is a choice in the menu: #1
  18. this is a choice in the menu: #2
  19. this is a choice in the menu: #3
  20. this is a choice in the menu: #4
  21. this is a choice in the menu: #5
  22.     @ This separates menu items from help text; the rest of the line is ignored
  23. You can also display a line of text for each menu item if you wish
  24. That way you can give up to 80 characters of extra explanation of menu items
  25. These lines will be centered and they can be very
  26. short
  27. or very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
  28. Notice that extra help lines beyond the number of menu items get ignored
  29. :echo3
  30. You picked choice $r
  31.   That menu was made with the command
  32.  
  33. @1FBatutil {AT=00}{CL}{MH This is a wide menu}{FM %0 echo2}
  34.  
  35. @1Ewhich uses the FMenu command to read in a menu from a file; in this
  36. case from this batch file itself!  The help text is in the same file
  37.  
  38.     Do you wish to see that menu again(Y/N)?
  39. :echo4
  40. You picked choice $r
  41.   That menu was made with the command:
  42.  
  43. @1FBatutil $(AT 30$)$(MN 70$)$(SH$)$(MH This is a menu header$)$(ME ....$)
  44.  
  45. @1E   Do you wish to see that menu again(Y/N)?
  46. :echo5
  47. You picked choice $r
  48.   That menu was made with the command:
  49.  
  50. @1FBatutil {PO}{FK}{ME This$$Smenu$$Shas$$Sfunction key$$Schoices$$Salso}
  51.  
  52. @1EIf one uses {PO +} instead of {PO} there are also sound effects
  53.  
  54.     What is your name, please?
  55.  
  56. :echo6
  57. You picked choice #$r
  58. That menu was made with the command:
  59. @1F    Batutil $(MEnu a b c d e f g h i j k l m n$)
  60.  
  61.   Do you wish to see that menu again(Y/N)?
  62. :code
  63. RC $
  64. la start
  65. AT=0A }{ CL }{ RO 8 }{ FP %0 echo1
  66. {AS} if $r=27 then goto end
  67. la firstmenu
  68. AT=30 }{ CL }{ AT=0 }{ MN=70 }{ SH}{ PO + }{ MH $W, $E $H:$m
  69. ME Here$Sis$Sa$Smenu$Swith many$Sfancy$Sfeatures$Senabled
  70. if $r=0 then goto end {AT=30}
  71. EC $_$_$_$_You picked choice $r$_  Do you wish to see that menu again (Y/N)?
  72. {CU +}  GE N CR Y {CU -} if $r=3 then goto firstmenu
  73. AT=3F { EC $_$_ }{ CO=5 } EC Menus can be tall and thin { GE WA2 }
  74. la secondmenu
  75. {AT=00}  CL  {ME a b c d e f g h i j k l m n } AT=1E {CL} {RO=5} {CO=1}
  76. if $r=0 then goto end
  77. {FP %0 echo6}
  78. {CU +} GE N CR Y {CU -} if $r=3 then goto secondmenu
  79. {AT=4E} EC $_$_  Or menus can be short and fat {GE WA2}
  80. la thirdmenu
  81. {AT=0E}{CL}{MH This is a wide menu}
  82. FM %0 echo2
  83. if $r=0 then goto end
  84. {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo3}
  85. {CU +} GE N CR Y {CU -} if $r=3 then goto thirdmenu
  86. {AT=4E} EC $_$_  Menus can have headers and/or a shadow {GE WA3}
  87. la fourthmenu
  88. {AT=00}{CL}{AT 30}{MN 70}{SH}{MH This is a menu header}
  89. ME you$Scan$SpIck a$ScHoice$Swith The$Shighlighted$Scapital$Sletter
  90. if $r=0 then goto end
  91. {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo4}
  92. {CU +} GE CR N Y {CU -} if $r=3 then goto fourthmenu
  93. {AT=4E} EC $_$_  Menus can explode with or without sound effects {GE WA3}
  94. la fifthmenu
  95. {AT=00}{CL}{PO}{FK}{ME This$Smenu$Shas$Sfunction key$Schoices$Salso}
  96. if $r=0 then goto end
  97. {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo5}{$1=$Q}
  98. {CL}{MH $1's Menu}{me eXit Last$Smenu Restart}
  99. if $r=3 then goto start
  100. if $r=2 then goto fifthmenu
  101. la end
  102. {CL}{RO 5}{CO 5}{PR Thank @1Fyou @1Efor trying @1FBATUTIL!$_}
  103. :end
  104.  
  105.